//
//  MyInformationViewController.swift
//  Jock
//
//  Created by HD on 15/4/8.
//  Copyright (c) 2015年 Haidy. All rights reserved.
//

import UIKit

class MyInformationViewController: UIViewController {
    
    var informationView: NearbyItemView!

    override func viewDidLoad() {
        super.viewDidLoad()
        
        informationView = ViewUtil.instanceView("NearbyItemView") as! NearbyItemView
        informationView.frame = CGRectMake(0, 0, self.view.frame.width, self.view.frame.height)
        self.view = informationView
        initView()
    }
    
    private func initView() {
        
    }
    
    private func initData() {
        
    }

    //加载数据
    private func loadData() {
        HttpClient().Get("http://nearby.qiushibaike.com/user/26943706/detail", response: { (response) -> Void in
            let userData = UserData.parser(JSON(data: response.data!))
            self.showUserInfo(userData)
            
        }) { (error) -> Void in
            println(error)
        }
    }
    
    //显示用户信息
    private func showUserInfo(userData: UserData) {
        informationView.nickNameView.text = userData.login
//        informationView.
    }
    
}
